package cn.geckos.xml
{
	import cn.geckos.util.StringUtil;
	
	public class AttributeList
	{
		public static const IMPLIED:String	=	"#IMPLIED";
		public static const REQUIRED:String	=	"#REQUIRED";
		public static const FIXED:String	=	"#FIXED";
		
		private var _name:String;
		private var _nodeName:String;
		private var _defaultValue:String;
		private var _valueRange:Array;
		private var _type:String;
		private var _declaration:String;
		
		public function set name(name:String):void
		{this._name = name;}
		public function get name():String
		{return this._name;}
		
		public function set nodeName(nn:String):void
		{this._nodeName = nn;}
		public function get nodeName():String
		{return this._nodeName;}
		
		public function set defaultValue(dv:String):void
		{this._defaultValue = dv;}
		public function get defaultValue():String
		{return this._defaultValue;}
		
		public function set valueRange(va:Array):void
		{this._valueRange = va;}
		public function get valueRange():Array
		{return this._valueRange;}
		
		public function set declaration(d:String):void
		{
			if(declarationValidation(d))
			{
				this._declaration = d;
			}else
			{
				throw new Error("the declaration of attitude list unqualified");
			}
		}
		
		public function declarationValidation(d:String):Boolean
		{
			switch(d)
			{
				case IMPLIED:
					return true;
				break;
				case REQUIRED:
					return true;
				break;
				case FIXED:
					return true;
				break;
				default:
					return false;
				break;
			}
		}
	}
}